﻿
@using Blazor.Diagrams.Components
@using AntDesign
@using AntDesign.ProLayout
@using AntDesign.Core
@using AntDesign.TableModels
@using Blazor.Diagrams.Core.Models.Base
@using ERP.Workflow.Designer.BlazorUI.Core
@using  ERP.Workflow.Designer.BlazorUI.Models
@using Blazor.Diagrams.Core.Models
@using  ERP.Workflow.Designer.BlazorUI.Domain
@implements IPropertyBox<Definition>

<Tabs  Animated  Centered  @bind-ActiveKey="@activeKey"     >
	  <TabPane Tab="流程基本信息" Key="1"  >
                <Row  Class="row">
                      <AntDesign.Col Span="10"  Class="col l"><lable class="lable">流程名</lable></AntDesign.Col>
                      <AntDesign.Col Span="14" Class="col">
                           <Input Size="small" style="width:120px;"  @bind-Value="Data!.Name" TValue="string"  OnChange="@((e)=>{change(nameof(Definition.Name),e);})"></Input>
                        </AntDesign.Col>       
                 </Row>  
                  <Row  Class="row">
                      <AntDesign.Col Span="10"  Class="col l"><lable class="lable">流程版本</lable></AntDesign.Col>
                      <AntDesign.Col Span="14" Class="col">
                           <Input Size="small" style="width:120px;"  @bind-Value="Data!.Version" TValue="string"  OnChange="@((e)=>{change(nameof(Definition.Version),e);})"></Input>
                        </AntDesign.Col>       
                 </Row>  

        </TabPane>
       
</Tabs>
@code {
    [Parameter] public Definition? Data { get; set; }
    protected string activeKey = TabItems.BaseInfo;

    // public event Action<PropertyChangeEventArg>? OnChange;

    [Parameter] public EventCallback<PropertyChangeEventArg> OnChange{ get; set; }
    protected override Task OnInitializedAsync()
    {
        return base.OnInitializedAsync();
    }

    public virtual void Refresh()
    {
        StateHasChanged();
    }
    protected void change(string field,string val)
    {
        OnChange.InvokeAsync(new PropertyChangeEventArg { Data = Data, FieldName = field, Value = val });
    }
}
